<?php

class Lib_Repair_Config
{
    private static $config = array(
        'LT' => array(
            'local' => [
                'api' => 'https://www.114credit.com/api2',
                //'token' => 'a112a43484b28641',
                'token' => '165a98f82eaef0bbba5b4cc6846e3912',
            ],

            'rls' => [
                'api' => 'https://www.114credit.com/api2',
                //'token' => 'a112a43484b28641',
                'token' => '165a98f82eaef0bbba5b4cc6846e3912',
            ],
        ),
        'ZR' => array(
            'local' => [
                'api' => 'https://fulian.zairui.net:9660/',
                'username' => '10000@dayoushang',
                'password' => 'dayoushang',
            ],
            'rls' => [
                'api' => 'https://fulian.zairui.net:9660/',
                'username' => '10000@dayoushang',
                'password' => 'dayoushang',
            ],
        ),
        'YD' => array(
            'local' => [
                'api' => 'https://app.sdbmcc.com:8443/telecom-lostcustomer-ws-api',
                'appid' => '3ec3ee6df7944b5e98e0c35357e11ac9',
                'appKey' => 'app123',
                'credential' => '0da8108540534b8c9ed45588477e3a85',
            ],
            'rls' => [
                'api' => 'https://app.sdbmcc.com:8443/telecom-lostcustomer-ws-api',
                'appid' => '39afa679d3c24f86b046ecc79a0855b7',
                'appKey' => 'app123',
                'credential' => '4a8de11789154349b6a97d6795b48c9d',
            ],
        ),
        'pass'=>[
            'YiDong',
            'LianTong',
            'ZaiRui'
        ],
        //'use_pass'=>'ZaiRui'
        'use_pass'=>'direct'

    );
    public static function getConfig($key,$diff_env = 1){
        if($diff_env){
            $env = getenv('RUNTIME_ENVIROMENT') ? getenv('RUNTIME_ENVIROMENT') : (defined('SHELL_VARIABLE') ? SHELL_VARIABLE : '');
            $env = empty($env)?'local':$env;
            $config = isset(self::$config[$key][$env]) ? self::$config[$key][$env] : array();
        }else{
            $config = isset(self::$config[$key]) ? self::$config[$key] : array();
        }
        return $config;
    }
}
